<template>
	<view class="content">
		<view class="top">
			<image class="top-image" mode="widthFix" src="https://api.cd1a.cn/imges/sharebg1.png"></image>
		</view>
		<view class="center">
			<view class="center-image-wrap">
				<image class="center-image" show-menu-by-longpress mode="widthFix" :src="mainData.url"></image>
			</view>
			<view class="center-txt">扫描二维码或点击下方邀请好友按钮即可完成</view>
			<view class="btn-wrap">
				<button class="btn" hover-class="none" type="default" open-type="share">邀请好友</button>
			</view>
		</view>
		<view class="bottom">
			<view class="bottom-title">
				邀请流程
			</view>
			<view class="sub-title">
				方法1
			</view>
			<view class="sub-content">
				让新用户直接扫描邀请二维码即可完成。
			</view>
			<view class="sub-title">
				方法2
			</view>
			<view class="sub-content">
				① 点击分享按钮；—— ② 在微信通讯录选择好友名单；—— ③ 新用户点击进入分享页面。
			</view>
			<view class="bottom-title bottom-title-02">
				积分规则
			</view>
			<view class="bottom-txt" v-for="(item,index) in mainData.content" :key="index">{{item}}</view>
		</view>
		<view class="bottom-safe-area"></view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				mainData:{}
			}
		},
		onLoad() {
			this.getDataRequest();
		},
		onShareAppMessage(){
		    return {
				title: '邀好友，赚积分',
				path:'/pages/index/index',
				imageUrl: 'https://api.cd1a.cn/imges/sharebg1.png',
		    }
		},
		methods: {
			getDataRequest(){
				this.$u.api.getNewUser().then(res=>{
					this.mainData=res;
				}).catch(()=>{});
				
			}
		}
	}
</script>

<style lang="scss" scoped>
	.top-image{
		width:100%;
		height:328rpx;
		display: block;
	}
	.center-image{
		width:100%;
		height:340rpx;
		display: block;
	}
	.center-image-wrap{
		width:380rpx;
		padding:20rpx;
		margin:0 auto;
		box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
	}
	.center{
		padding:50rpx 0 30rpx 0;
	}
	.center-txt{
		text-align: center;
		font-size: 22rpx;
		padding-top: 20rpx;
		
	}
	.btn{
		border: none;
		background-color:#f6664f;
		color:#fff;
	}
	.btn-wrap{
		width:600rpx;
		margin:0 auto;
		padding-top: 40rpx;
		padding-bottom: 40rpx;
	}
	.bottom-title{
		width:160rpx;
		text-align: center;
		font-size: 30rpx;
		color: #000000;
		margin:20rpx auto;
		font-weight: bold;
		line-height: 1;
		border-left: 4rpx solid #f6664f;
		border-right: 4rpx solid #f6664f;
	}
	.sub-title{
		font-size: 24rpx;
		background: #f6664f;
		color: #FFF;
		display: inline-block;
		border-radius: 16rpx;
		padding: 0 12rpx;
		height: 33rpx;
		line-height: 30rpx;
		margin-bottom: 10rpx;
		margin-top: 10rpx;
	}
	.bottom{
		padding:0 24rpx;
		padding-bottom: 40rpx;
	}
	.sub-content{
		font-size: 24rpx;
		color: #333;
		line-height: 46rpx;
	}
	.bottom-txt{
	
		font-size: 24rpx;
		color: #333;
		line-height: 32rpx;
		margin-top: 32rpx;
	}
	.bottom-title-02{
		margin-top: 50rpx;
	}
</style>

